﻿using ShopEnzi.Data.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ShopEnzi.Data.Maps
{
    public class CategoryMap : NH.Beng.NHClassIntMap<Category>
    {
        public CategoryMap()
        {
            Map(x => x.Name);
            Map(x => x.Type);
            References(x => x.ParentCategory);
            HasManyToMany(x => x.Products).AsBag().Cascade.SaveUpdate().NotFound.Ignore().Table("CategoryToProduct");
        }
    }
}
